#ifndef CASTLINGACTION_HPP_
#	define CASTLINGACTION_HPP_

#	include "Action.hpp"
#	include "Chess.hpp"
#	include "CriticalException.hpp"
#	include "Player.hpp"

class CastlingAction : public Action
{
	
	public:
		typedef void (CastlingFunction) (Chess::Color color);
		enum Type { QUEEN_SIDE = 0, KING_SIDE };

		CastlingAction(Chess::Color color, CastlingAction::Type ctype);
		virtual ~CastlingAction();
		
		virtual void execute();
		CastlingAction::Type 	getCastlingType() const;
	
	protected:
		CastlingAction::Type 	ctype;
	
		static CastlingAction::CastlingFunction* cast_funcs[KING_SIDE + 1];
		static void castling_king_side(Chess::Color);
		static void castling_queen_side(Chess::Color);
};


#endif
